#pragma once
#include<graphics.h>
#include"Sence.h"

extern Sence* menu_sence;
extern Sence* game_sence;
extern Sence* selector_sence;
class SenceManager
{
public:
	enum class Sence_Type
	{
		MENU,
		GAME,
		Selector
	};

	void set_current_sence(Sence* sence)
	{
		_sence = sence;
		_sence->on_enter();
	}

	void switch_to(Sence_Type type)
	{
		_sence->on_exit();
		switch (type)
		{
		case Sence_Type::MENU:
			_sence = menu_sence;
			break;
		case Sence_Type::GAME:
			_sence = game_sence;
			break;
		case Sence_Type::Selector:
			_sence = selector_sence;
			break;
		}
		_sence->on_enter();
	}

	void on_draw()
	{
		_sence->on_draw();
	}

	void on_update(int interval)
	{
		_sence->on_update(interval);
	}

	void on_input(ExMessage& msg)
	{
		_sence->on_input(msg);
	}

	void on_exit()
	{
		_sence->on_exit();
	}

private:
	Sence* _sence = nullptr;
};